Repository navigation
[feat] Add codeExecutor.env and codeExecutor.environmentVariables - #430
cameronattard wants to merge 1 commit into
Conversation
[Medium impact] The change reaches environment configuration for the code-executor workload. The PR appears safe to merge, with a non-blocking request to test secret-backed entries directly. Findings
Reviews (1) · Last reviewed commit: "[feat] Add codeExecutor.env and codeExec..." · Reviewed by Greptile |
| def test_list_env_reaches_the_code_executor(self): | ||
| out = render("codeExecutor.environmentVariables[0].name=CE_ONLY", | ||
| "codeExecutor.environmentVariables[0].value=1") | ||
| self.assertIn("CE_ONLY", env_names(out, "deployment_code_executor.yaml")) | ||
| self.assertNotIn("CE_ONLY", env_names(out, "deployment_backend.yaml")) |
There was a problem hiding this comment.
Secret-backed entries go untested
The new list test checks only the variable's name. It never supplies or checks valueFrom, although secret-backed entries are part of this feature. The CI fixture includes one, but its schema check would still pass if the template dropped the entry entirely.
Add a render assertion for the full valueFrom.secretKeyRef entry and confirm it stays out of the backend. This is non-blocking test coverage feedback.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Added in 5c8665f: test_secret_backed_list_entry_renders_in_full asserts the full valueFrom.secretKeyRef entry on the code executor and that it stays off the backend. It fails if the template drops the list.
Settings only the code executor reads could only be set through the top-level env, which every Retool pod receives. The code executor now also takes its own env (map) and environmentVariables (list), rendered after the shared ones so they take precedence. The shared env is still inherited, so existing installs are unchanged.
b0527c2 to
5c8665f
Compare
What
Adds
codeExecutor.env(map, same format as the top-levelenv) andcodeExecutor.environmentVariables(list,valueFromsupported). They render after the shared top-levelenv/environmentSecrets/environmentVariables, so a name set in both takes the code-executor value.Why
Some settings are read only by the code executor, such as options for its sandbox. Today the only way to set them is the top-level
env, which puts them on every Retool pod.The JS executor already has its own
env/environmentVariables(not inherited). For the code executor this PR keeps inheriting the shared environment and adds the new values on top, so existing installs render identically.Verified
.github/test_code_executor_env.py, wired intoci.yaml, checks four things:helm lintandschema/generate.sh --checkpass; the twovalues.yamlfiles are in sync.charts/retool/ci/test-code-executor-env-option.yaml, so kubeconform validates the new path (passes locally with kubeconform 0.6.7 against Kubernetes 1.31.1).